searchentry: Fix keynav
authorMatthias Clasen <mclasen@redhat.com>
Mon, 15 Jun 2020 17:45:57 +0000 (13:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 Jun 2020 17:48:03 +0000 (13:48 -0400)
Shift-Tabbing was getting stuck in GtkSearchEntry and
GtkPasswordEntry, since they grab the focus to a child
of theirs. Copy the same fix that we are already using
in GtkEntry.

Fixes: #2842
gtk/gtkpasswordentry.c
gtk/gtksearchentry.c

index 66acb6fa946e8ea0904236e22d85b9b1598f5b86..391f5076edd6729f5734a6d0f0bb7ea6bf110224 100644 (file)
@@ -378,6 +378,7 @@ gtk_password_entry_class_init (GtkPasswordEntryClass *klass)
   widget_class->size_allocate = gtk_password_entry_size_allocate;
   widget_class->mnemonic_activate = gtk_password_entry_mnemonic_activate;
   widget_class->grab_focus = gtk_widget_grab_focus_child;
+  widget_class->focus = gtk_widget_focus_child;
 
   props[PROP_PLACEHOLDER_TEXT] =
       g_param_spec_string ("placeholder-text",
index 0ccf639e8755dbe7d161cecd382638482e763671..d203f9d1a9a978ee973a4706b23b3e28b2461e5d 100644 (file)
@@ -40,6 +40,7 @@
 #include "gtkmarshalers.h"
 #include "gtkstylecontext.h"
 #include "gtkeventcontrollerkey.h"
+#include "gtkwidgetprivate.h"
 #include "a11y/gtksearchentryaccessible.h"
 
 
@@ -249,6 +250,7 @@ gtk_search_entry_class_init (GtkSearchEntryClass *klass)
   object_class->set_property = gtk_search_entry_set_property;
 
   widget_class->grab_focus = gtk_search_entry_grab_focus;
+  widget_class->focus = gtk_widget_focus_child;
   widget_class->mnemonic_activate = gtk_search_entry_mnemonic_activate;
 
   klass->stop_search = gtk_search_entry_stop_search;